{% include "partial/header.html" %}
<div class="layui-container index">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md8">
            <div class="layui-card">
                <div class="layui-card-body">
                    <ul class="article-list">
                        {% for item in articles %}
                        <li class="item">
                            <a href="{{getUrl("article", item, 0)}}" class="link">
                                <h5 class="title">{{item.Title}}</h5>
                                <div class="description">{{item.Description}}</div>
                                <div class="meta">
                                    {% if item.Category %}<span>{{item.Category.Title}}</span>{% endif %}
                                    <span>{{stampToDate(item.CreatedTime, "2006-01-02")}}</span>
                                    <span>{{item.Views}} 阅读</span>
                                </div>
                            </a>
                        </li>
                        {% empty %}
                        <li class="item empty">
                            该列表没有任何内容
                        </li>
                        {% endfor %}
                    </ul>
                </div>
                {% if prevPage || nextPage %}
                <div class="layui-card-body text-center">
                    <div class="layui-box layui-laypage">
                        <a href="{{prevPage}}" class="layui-laypage-prev{% if !prevPage %} layui-disabled{% endif %}">上一页</a>
                        <a href="{{nextPage}}" class="layui-laypage-next{% if !nextPage %} layui-disabled{% endif %}">下一页</a>
                    </div>
                </div>
                {% endif %}
            </div>
        </div>

        <div class="layui-col-md4">
            {% include "partial/author.html" %}
            <div class="layui-card">
                <div class="layui-card-header">文章分类</div>
                <div class="layui-card-body">
                    <ul class="aside-list">
                        {% for item in articleCategories %}
                        <li class="item">
                            <a href="{{getUrl("category", item, 0)}}" class="link">
                                <h5 class="title">{{item.Title}}</h5>
                            </a>
                        </li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-card-header">产品分类</div>
                <div class="layui-card-body">
                    <ul class="aside-list">
                        {% for item in productCategories %}
                        <li class="item">
                            <a href="{{getUrl("category", item, 0)}}" class="link">
                                <h5 class="title">{{item.Title}}</h5>
                            </a>
                        </li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
            <div class="layui-card">
                <div class="layui-card-header">热门文章</div>
                <div class="layui-card-body">
                    <ul class="aside-list">
                        {% for item in populars %}
                        <li class="item">
                            <a href="{{getUrl("article", item, 0)}}" class="link">
                                <h5 class="title">{{item.Title}}</h5>
                                <span class="extra">{{item.Views}}阅读</span>
                            </a>
                        </li>
                        {% endfor %}
                    </ul>
                </div>
            </div>
        </div>
    </div>
    {% if links %}
    <div class="friend-links">
        <span class="title">友情链接：</span>
        {% for item in links %}
        <a class="item" href="{{item.Link}}" {% if item.Nofollow == 1 %} rel="nofollow"{% endif %} target="_blank">{{item.Title}}</a>
        {% endfor %}
    </div>
    {% endif %}
</div>
{% include "partial/footer.html" %}